﻿<UserControl x:Class="GSF.TimeSeries.UI.UserControls.IaonTreeUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="650" d:DesignWidth="850"
             xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls"
             xmlns:tsfBinding="clr-namespace:GSF.TimeSeries.UI.Binding;assembly=GSF.TimeSeries.UI"
             Background="Transparent">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    
    <Grid x:Name="LayoutRoot">
        <Border>
            <StackPanel Orientation="Vertical">
                <StackPanel.Resources>
                    <HierarchicalDataTemplate x:Key="ChildNodeTemplate">
                        <StackPanel sdk:ToolTipService.ShowDuration="60000" Orientation="Horizontal">
                            <ToolTipService.ToolTip>
                                <TextBlock Width="500" TextWrapping="Wrap" Text="{Binding Path=ConnectionString}"/>
                            </ToolTipService.ToolTip>
                            <TextBlock Width="{StaticResource LargeItemSize}" Text="{Binding Path=AdapterName}" TextAlignment="Left"/>
                            <TextBlock Width="{StaticResource XLargeItemSize}" Text="{Binding Path=AssemblyName}" TextAlignment="Left"/>
                            <TextBlock Width="{StaticResource XXLargeItemSize}" Text="{Binding Path=TypeName}" TextAlignment="Left"/>
                        </StackPanel>
                    </HierarchicalDataTemplate>
                    <HierarchicalDataTemplate x:Key="RootNodeTemplate" ItemTemplate="{StaticResource ChildNodeTemplate}" ItemsSource="{Binding Path=AdapterList}">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Text="{Binding Path=AdapterType}" FontSize="{StaticResource LargeTextSize}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Bold" Margin="5"/>
                            <Border>
                                <StackPanel Orientation="Horizontal" Margin="2">
                                    <TextBlock Text="" Width="{StaticResource BlankItemSize}" TextAlignment="Center" FontWeight="Bold"/>                                    
                                    <TextBlock Text="Adapter Name" Width="{StaticResource LargeItemSize}" TextAlignment="Center" FontWeight="Bold"/>
                                    <TextBlock Text="Assembly Name" Width="{StaticResource XLargeItemSize}" TextAlignment="Center" FontWeight="Bold"/>
                                    <TextBlock Text="Type Name" Width="{StaticResource XXLargeItemSize}" TextAlignment="Center" FontWeight="Bold"/>                                    
                                </StackPanel>
                            </Border>
                        </StackPanel>
                    </HierarchicalDataTemplate>
                    <Style x:Key="ExpandedItemStyle" TargetType="TreeViewItem">
                        <Setter Property="IsExpanded" Value="True"/>
                    </Style>
                </StackPanel.Resources>
                
                <TreeView x:Name="TreeViewIaon" ItemTemplate="{StaticResource RootNodeTemplate}" Height="635" ItemContainerStyle="{StaticResource ExpandedItemStyle}" 
                          ItemsSource="{tsfBinding:Column Path=ItemsSource}" Background="Transparent" BorderThickness="0" HorizontalAlignment="Left">
                    
                </TreeView>
            </StackPanel>
        </Border>
            
    </Grid>
</UserControl>
